<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<c:set value="${param.card}" scope="page" var="card"/>
<div class="card bg-base-100 shadow-xl">
    <figure class="relative pt-[140%]">
        <img src="${card.image}" alt="${card.alt}" class="absolute inset-0 w-full h-full object-cover"/>
        <div class="absolute top-0 right-0 m-2 badge badge-${card.badgeClass}">${card.badgeText}</div>
    </figure>
    <div class="card-body p-2">
        <h3 class="card-title text-sm">${card.title}</h3>
        <p class="text-xs text-gray-400">${card.description}</p>
        <div class="flex items-center mt-1">
            <c:if test="${not empty card.rating}">
                <div class="rating rating-sm">
                    <c:forEach begin="1" end="${card.rating}" var="star">
                        <input type="radio" name="rating-${card.id}" class="mask mask-star-2 bg-orange-400" checked/>
                    </c:forEach>
                </div>
                <span class="text-xs text-gray-400 ml-1">${card.ratingValue}</span>
            </c:if>
        </div>
    </div>
</div>
